<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <!-- 写一个可以实现任意数组的去重的“函数”
  假设有数组["a","b","c","d","a","a","c","d","e","b"]代码去重,得到结果:["a","b","c","d","e"] -->

    <!-- 查找第一个字符，如果数组里面没有就放在空数组里面 -->


    <script>
        let arr = ["a", "b", "c", "d", "a", "a", "c", "d", "e", "b"]

        let arrs = []
        arr.forEach(function (v) {
            if (arrs.indexOf(v) == -1) {
                arrs.push(v)
            }
        })
        console.log(arrs);
    </script>
</body>

</html>